import request from '@/utils/request'

export function useDict(const_code) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.ConstantItemQueryByCode',
    method: 'post',
    data: {
      const_code,
    },
  })
}

export function getList(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.ConstantQuery',
    method: 'post',
    data,
  })
}

export function doEdit(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.UpdateConstant',
    method: 'post',
    data,
  })
}

export function doAdd(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.AddConstant',
    method: 'post',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.DeleteConstant',
    method: 'post',
    data,
  })
}

export function getItemList(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.ConstantItemQueryByID',
    method: 'post',
    data,
  })
}

export function addItem(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.AddConstItem',
    method: 'post',
    data,
  })
}

export function editItem(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.UpdateConstItem',
    method: 'post',
    data,
  })
}

export function deleteItem(data) {
  return request({
    url: '/admin.php?s=Admin.Basic_Constant.DeleteConstItem',
    method: 'post',
    data,
  })
}
